-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pretty formatting for types #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling it format(decltype, "name")
to just get a declaration with a name seems a bit weird. Perhaps it should be a method and have the string formatting as a convenience?
It's true, the name format thing is a bit weird. |
@trelau if you have any thoughts about this your input is welcome |
Coming back to this, I still don't think this is the right fit. In particular, there are several elements that one could format in one of several different ways depending on what you wanted. |
8bd749e
to
5e16f16
Compare
9d22018
to
4dc64b5
Compare
Changed to |
6b78c5e
to
f988ff1
Compare
I like it, but is it too clever? Open to suggestions.
Normal string formatting converts to the canonical expected representation, but if you want to make a declaration then you need to either call
__format__
directly, or you can pass a format spec with the name in it (f"{type:name}"
).